package com.gosophia.dataDictionary.action;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;

import com.gosophia.commons.web.action.BaseAjaxAction;
import com.gosophia.commons.web.logAnnotation.LogRecord;
import com.gosophia.dataDictionary.dto.DataValueDTO;
import com.gosophia.dataDictionary.ws.DataDictionaryWebService;



/**
 * 删除数据值
 * 
 * @author tianchunyu
 * 
 */
@Controller
@Scope("prototype")
public class DeleteDataValueAction extends BaseAjaxAction<DataValueDTO> {

    /**
     * 
     */
    private static final long serialVersionUID = 1L;

    @Override
    public DataValueDTO getDetailData() {
        if (this.detailData == null) {
            this.detailData = new DataValueDTO();
        }
        return this.detailData;
    }

    @Autowired
    private DataDictionaryWebService dataDictionaryWebService;

    @LogRecord(eventAction="数据字典-删除数据值",eventTarget="detailData")
    @Override
    public String _execute() throws Exception {
        dataDictionaryWebService.removeDataValue(this.detailData);
        
        getRequestResult().setRsltCode("0");
        getRequestResult().setMessage("数据值删除成功");

        return SUCCESS;
    }

 
}
